package com.example.demo.pojo;


public class PageResult extends Result{
    private Integer count;
    private Integer total;
    private Object data;


    public PageResult(int code, String msg, Integer total, Object data) {
        this.code = code;
        this.msg = msg;
        this.total = total;
        this.data = data;
    }
    public PageResult(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public PageResult(int code, String msg , Object data, Integer count) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.count = count;
    }

    public PageResult() {
    }



    public static PageResult success01(Integer total,Object data){
        return new PageResult(200,"获取成功",total,data);
    }

    public static PageResult success02(Object data){
        return new PageResult(200,"获取成功",data);
    }

    public static PageResult success03(Object data,Integer count){
        return new PageResult(200,"获取成功",data,count);
    }

    /**
     * 获取
     * @return total
     */
    public Integer getTotal() {
        return total;
    }

    /**
     * 设置
     * @param total
     */
    public void setTotal(Integer total) {
        this.total = total;
    }

    /**
     * 获取
     * @return data
     */
    public Object getData() {
        return data;
    }

    /**
     * 设置
     * @param data
     */
    public void setData(Object data) {
        this.data = data;
    }

    /**
     * 获取
     * @return count
     */
    public Integer getCount() {
        return count;
    }

    /**
     * 设置
     * @param count
     */
    public void setCount(Integer count) {
        this.count = count;
    }

    public String toString() {
        return "PageResult{total = " + total + ", data = " + data + ", count = " + count + "}";
    }
}
